module('PlatformUtils', package.seeall)

local IphoneXDeviceCode = {
    "iPhone10,3",
    "iPhone10,6",
    "iPhone11,2",
    'iPhone11,4',
    "iPhone11,6",
    "iPhone11,8",
    "iPhone12,1",
    "iPhone12,3",
    "iPhone12,5",
    "iPhone13,1",
    "iPhone13,2",
    "iPhone13,3",
    "iPhone13,4",
}

function IsRuntimeIphoneX()
    if Application.platform == UnityEngine.RuntimePlatform.IPhonePlayer then
        local modelStr = UnityEngine.SystemInfo.deviceModel
        return table.find(IphoneXDeviceCode, modelStr) > 0
    elseif Application.platform == UnityEngine.RuntimePlatform.Android then
        local isLiuhai = false
        pcall(function()
            isLiuhai = PlatformUtilsSharp.IsAndroidLiuhai()
        end)
        return isLiuhai
    else
        return false
    end
end

function TapticImpact()
    if Application.platform == UnityEngine.RuntimePlatform.IPhonePlayer and TapticPlugin.TapticManager.IsSupport() then
        TapticPlugin.TapticManager.Impact(TapticPlugin.ImpactFeedback.Medium)
    elseif Application.platform == UnityEngine.RuntimePlatform.Android then
        AndroidTapticManager.HapticFeedback()
    end
end